$(function(){
    $('.container').fullpage({
        verticalCentered:false,/*取消垂直居中*/
        sectionsColor: ["#fadd67", "#84a2d4", "#ef674d", "#ffeedd", "#d04759", "#84d9ed", "#8ac060"],
        navigation:true,
        /*页面切换的时间 默认是700*/
        scrollingSpeed:1000,
        afterLoad:function (link,index) {
            /*index 序号 1开始  当前屏的序号*/
            console.log($(".section").eq(index-1));
            $('.section').eq(index-1).addClass('now');
        },
        afterRender:function () {
            $(".more").on("click",function () {
               $.fn.fullpage.moveSectionDown();
            });
           /* $('.screen04 .cart').on('transitionend',function () {
                /!* :last :first :visible :hidden :checked :selected jquery扩展选择器*!/
                $('.screen04 .address').show().find('img:last').fadeIn(1000);
                $('.screen04 .text').addClass('show');
            });*/
           $(".screen08").on("mousemove",function (e) {
               $(this).find(".hand").css({
                   left:e.clientX-250,
                   top:e.clientY-100
               });
           $(".screen08").find(".again").click(function () {
               $('.now,.leaved,.show').removeClass('now').removeClass('leaved').removeClass('show');
               $('.content [style]').removeAttr('style');
              $.fn.fullpage.moveTo(1);
           });
           });
        },
        onLeave:function (index,nextIndex,direction) {
            if(index ===2&&nextIndex===3){
                $(".section").eq(index-1).addClass("leaved");
            }
            else if(index===3&&nextIndex===4){
                $(".section").eq(index-1).addClass("leaved");
            }
            else if(index===5&&nextIndex===6){
                $(".section").eq(index-1).addClass("leaved");
                $('.screen06 .box').addClass('show');
            }
            else if(index===6&&nextIndex===7){
                $(".screen07 .star img").each(function (index,item) {
                   $(item).delay(index*0.5*1000).fadeIn();
                });
                $('.screen07 .text').addClass('show');
            }
        }
    });
});